from django.urls import re_path
from rest_framework.urlpatterns import format_suffix_patterns

from .apps import ApprovalConfig
from .views_api import *

app_name = ApprovalConfig.name


urlpatterns = format_suffix_patterns([
    re_path(r'^projects/$', ProjectListCreateAPIView.as_view(), name='projects'),
    re_path(r'^projects/(?P<pk>[0-9]+)/$', ProjectRetrieveUpdateAPIView.as_view(), name='project'),
    re_path(r'^application_types/$', ApplicationTypeListCreateAPIView.as_view(), name='application_types'),
    re_path(r'^application_types/(?P<pk>[0-9]+)/$', ApplicationTypeRetrieveUpdateAPIView.as_view(),
            name='application_type'),
    re_path(r'^applications/$', ApplicationListCreateAPIView.as_view(), name='applications'),
    re_path(r'^applications/(?P<pk>[0-9]+)/$', ApplicationRetrieveUpdateAPIView.as_view(), name='application'),
    re_path(r'^application_attachments/$', ApplicationAttachmentListCreateAPIView.as_view(),
            name='application_attachments'),
    re_path(r'^application_attachments/(?P<pk>[0-9]+)/$', ApplicationAttachmentRetrieveUpdateAPIView.as_view(),
            name='application_attachment'),
])
